<%= decidim_modal id: "socialShare", class: "share-modal" do %>
  <div data-dialog-container>
    <h2 tabindex="-1" data-dialog-title><%= t("share", scope: "decidim.shared.share_modal") %></h2>

    <div>

      <div class="share-modal__list" data-social-share>
        <%= social_share_button_tag(decidim_page_title,
                                    url: resource_url,
                                    image: decidim_meta_image_url,
                                    desc: decidim_html_escape(decidim_meta_description || ""),
                                    via: decidim_meta_twitter_handler) %>

        <%= render_social_share_button(Decidim.social_share_services_registry.find("QR"), decidim_page_title,
                                       url: resource_url,
                                       image: decidim_meta_image_url,
                                       desc: decidim_html_escape(decidim_meta_description || ""),
                                       via: decidim_meta_twitter_handler) %>
      </div>

      <p><%= t("copy_share_link_cta", scope: "decidim.shared.share_modal") %></p>
      <div class="share-modal__input">
        <input id="urlShareLink" type="text" title="<%= t("share_link" , scope: "decidim.shared.share_modal") %>" value="<%= resource_url %>" readonly>
        <button type="button"
                class="button button__sm button__text-secondary"
                data-controller="clipboard-copy"
                data-clipboard-copy="#urlShareLink"
                data-clipboard-copy-label="<%= t("copy_share_link_copied", scope: "decidim.shared.share_modal") %>"
                data-clipboard-copy-message="<%= t("copy_share_link_message", scope: "decidim.shared.share_modal") %>"
                title="<%= t("copy_share_link_clarification", scope: "decidim.shared.share_modal") %>">
          <span><%= t("copy_share_link", scope: "decidim.shared.share_modal") %></span>
          <%= icon "file-copy-line" %>
        </button>
      </div>
    </div>
  </div>
<% end %>
